# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-http-parser
_pkgname=http-parser
pkgver=0.9.0
pkgrel=12
pkgdesc='HTTP request/response parser for Python.'
arch=('x86_64' 'aarch64')
license=('MIT')
url='https://github.com/benoitc/http-parser'
depends=('python')
makedepends=('python-setuptools' 'cython')
source=("https://github.com/benoitc/http-parser/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('75e51bef43d9d7698aad69f8bfe651e24784b97603cac55f33bf4c12c86792c8c71d6206f31847d052e4d8621a5ea65a7b34eca5bebdb8189f58e6d98d33139d')

prepare() {
  rm "$_pkgname-$pkgver/http_parser/parser.c"
}

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

